Product Code Database
Example Keywords: science -tekken $17
barcode-scavenger
   » » Wiki: Rewrite Engine
Tag Wiki 'Rewrite Engine'.
Tag

Rewrite engine
 (

In , a rewrite engine is a software component that performs on (Uniform Resource Locators), modifying their appearance. This modification is called URL rewriting. It is a way of implementing or routing within a . The engine is typically a component of a or web application framework. Rewritten URLs (sometimes known as short, pretty or fancy URLs, search engine friendly - SEF URLs, or slugs) are used to provide shorter and more relevant-looking links to web pages. The technique adds a layer of between the files used to generate a web page and the URL that is presented to the outside world.


Usage
Web sites with dynamic content can use URLs that generate pages from the server using parameters. These are often rewritten to resemble URLs for static pages on a site with a subdirectory hierarchy. For example, the URL to a page with title Rewrite_engine might be:
http://example.com/w/index.php?title=Rewrite_engine
     
but can be rewritten as:
http://example.com/wiki/Rewrite_engine
     

A might have a URL that encodes the dates of each entry:

http://www.example.com/Blog/Posts.php?Year=2006&Month=12&Day=19
     
It can be altered like this:
http://www.example.com/Blog/2006/12/19/
     
which also allows the user to change the URL to see all postings available in December, simply by removing the text encoding the day '19', as though navigating "up" a directory:
http://www.example.com/Blog/2006/12/
     

A site can pass specialized terms from the URL to its as a search term. This would allow users to search directly from their browser. For example, the URL as entered into the browser's :

http://example.com/search term
     
will be by the browser before it makes the . The server could rewrite this to:
http://example.com/search.php?q=search%20term
     


Benefits and drawbacks
There are several benefits to using URL rewriting:Many of these only apply to HTTP servers whose default behavior is to map URLs to entities (i.e. files and directories); certain environments, such as many HTTP application server platforms, make this irrelevant.
  • The links are "cleaner" and more descriptive, improving their "friendliness" to both and search engines.
  • They prevent undesired "", which can waste bandwidth.
  • The site can continue to use the same URLs even if the underlying technology used to serve them is changed (for example, switching to a new ).

There can, however be drawbacks as well; if a user wants to modify a URL to retrieve new data, URL rewriting may hinder the construction of custom queries due to the lack of named variables. For example, it may be difficult to determine the date from the following format:

http://www.example.com/Blog/06/04/02/
     
In this case, the original query string was more useful, since the query variables indicated month and day:
http://www.example.com/Blog/Posts.php?Year=06&Month=04&Day=02
     


Web frameworks
Many web frameworks include URL rewriting, either directly or through extension modules.

  • Apache HTTP Server has URL rewriting provided by the mod_rewrite module. mod_rewrite documentation
  • URL Rewrite is available as an extension to Microsoft IIS. URL Rewrite extension for Microsoft IIS
  • Ruby on Rails has built-in URL rewriting via Routes.
  • has extendable URL rewriting via the OCPsoft URLRewriteFilter and Tuckey UrlRewriteFilter.
  • has simplified URL rewriting via the PrettyFaces: URLRewriteFilter.
  • Django uses a regular-expressions-based system. This is not strictly URL rewriting since there is no script to 'rewrite' to, nor even a directory structure; but it provides the full flexibility of URL rewriting. Django URLconf
  • Java Stripes Framework has had integrated functionality since version 1.5. clean urls in Stripes 1.5
  • Many Perl frameworks, such as and Catalyst, have this feature. Guides - Mojolicious guide to the galaxy. Mojolicious. Retrieved on 2013-09-08.
  • has URL rewriting provided.
  • has a mod_rewrite module. Docs ModRewrite - Lighttpd - lighty labs. Redmine.lighttpd.net. Retrieved on 2013-09-08.
  • has a rewrite module. For example, a multi-link multi-variable page generation from a like is possible, where multiple individual parts like get expanded with the help of regular expressions into variables to signify and so forth.
  • Hiawatha HTTP server has a URL Toolkit which supports URL rewriting. URL TOOLKIT part of Hiawatha webserver's manual
  • Cherokee HTTP server supports regular expressions of URL rewriting and redirections.

From a software development perspective, URL rewriting can aid in code modularization and , making it a useful feature of modern web frameworks.


See also
  • Application Delivery Controller
  • .htaccess
  • Apache HTTP Server
  • Content negotiation
  • Internet Information Server
  • Zeus Web Server


Notes

External links

Page 1 of 1
1
Page 1 of 1
1

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs